package com.ruoyi.produce.base.circulatingWater.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.produce.base.circulatingWater.domain.CirculatingWater;
import com.ruoyi.produce.base.circulatingWater.domain.CirculatingWaterCond;
import com.ruoyi.produce.base.circulatingWater.domain.CirculatingWaterDto;
import com.ruoyi.produce.base.circulatingWater.service.ICirculatingWaterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/produce/data/water")
@Api(value = "循环水模块", tags = "循环水接口")
public class CirculatingWaterController extends BaseController {
    @Autowired
    private ICirculatingWaterService circulatingWaterService;

    /**
     * 根据搜索条件所有循环水数据记录
     * @param cond 搜索条件
     * @return
     */
    @ApiOperation("读取循环水数据列表")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody CirculatingWaterCond cond) {
        startPage();
        List<CirculatingWaterDto> circulatingWaters = circulatingWaterService.selectCirculatingWaterList(cond);
        return getDataTable(circulatingWaters);
    }
}
